Skip to content

Conversation

jochem-brouwer
Copy link
Member

🗒️ Description

This PR ports the tests from https://github.com/imapp-pl/gas-cost-estimator/blob/master/docs/report_stage_iv.md to here. Keeping this as draft because we likely want to edit the presentation of these tests and the folder structure (if we want to integrate this in EEST at all, therefore also keeping this branch at my own fork).

To fill tests: uv run fill --evm-bin=/home/jochem/Documents/ejs/hive/clients/ethereumjs/ethereumjs-monorepo/packages/vm/test/t8n/ethereumjs-t8ntool.sh --clean --evm-dump-dir=./dump -m benchmark ./tests/benchmark/imapp-gas-cost-estimator/test_all.py --fork=Prague (this fills with EthereumJS and creates also debug dumps)

✅ Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx --with=tox-uv tox -e lint,typecheck,spellcheck,markdownlint
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

@jochem-brouwer jochem-brouwer changed the title Imapp pl tests port feat(tests): port of all imapp-pl/gas-cost-estimator bench tests to StateTests Sep 22, 2025
@LouisTsai-Csie
Copy link
Collaborator

This repo is really impressive, I especially like their research papers section: https://github.com/imapp-pl/gas-cost-estimator/tree/master/docs/notes/papers

I’m wondering if it would be feasible for us to convert the bytecode into our structure for better readability? That way, we could organize it into the corresponding files and folders as suggested in this issue. I’d be happy to help with the conversion.

Secondly, these benchmarks don’t actually exhaust the block gas limit, since the operations don’t include a jump loop that runs until OOG, would it be the worst case for each opcode/precompile?

@jochem-brouwer
Copy link
Member Author

I think you mean by "our structure" to have better readability e.g. Op.ADD(1,2) instead of extracting these raw strings?

I opened this PR for @misilva73 such that these tests from the report could directly be ran using EEST, in the context to help with verifying the report and setting up initial tests for the gas repricing EIP. You are correct that these do not consume the block gas limit (in fact most if not all consume a fixed amount of gas, since indeed as you already observed there are no loops! 😄 👍 ). The reason for this is that those tests were the programs used from the linked report.

I think I actually don't want these tests in EEST, because they are not the benchmark format which we expect (it has a gas limit parameter which should target the gas limit we want to execute) and they are also not edge cases or meaningful additions to add.

Will leave this open for a day but feel free to close if you also think so!

@spencer-tb
Copy link
Contributor

FYI I think we have tool to convert bytecode to our python opcode langauge!

The primary reason for closing atm is to prepare for the Weld! We can re-open in EELS post Weld if still interested :D

@fselmo
Copy link
Collaborator

fselmo commented Oct 9, 2025

The primary reason for closing atm is to prepare for the Weld! We can re-open in EELS post Weld if still interested :D

Seems reasonable. We can revisit whether we want to add these post-weld.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants